import * as companyAPi from '@/api/hmmm/companys'
// import * as dataOverviewApi from '../../../api/hmmm/dataOverviewApi'
// import { login, logout, profile } from '@/api/base/frame'
// import { dataOverviewApi } from '@/api/hmmm/dataOverview'

const companyInfo = {
  namespaced: true,
  state: {
    companyList: {
      items: []
    },
    detailCompany: {}
  },
  mutations: {
    SET_COMPANY_INFO: (state, newValue) => {
      state.companyList = newValue
    },
    SET_DETAIL_COMPANY: (state, newValue) => {
      state.detailCompany = newValue
    },
  },
  actions: {
    async updateCompanyList (context, data) {
      const res = await companyAPi.getCompanyList(data)
      context.commit('SET_COMPANY_INFO', res)
    },
    async updateDetailCompany (context, data) {
      const res = await companyAPi.detailCompany(data)
      context.commit('SET_DETAIL_COMPANY', res)
    }
  }
}

export default companyInfo
